import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import * as ElIcon from '@element-plus/icons-vue'
import router from './router/index.js'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import permission from '@/permission/permission.js';
// import { useRouter } from "vue-router";
// import axios from 'axios';


var app=createApp(App)
app.use(ElementPlus)
app.use(router) // 注册 router

// var routers = useRouter();
// axios.interceptors.request.use(
//   (config) => {
//     if (routers.currentRoute._value.query.name != null) {
//       console.log("111");
//       config.headers["Authorization"] =
//         "Bearer " + routers.currentRoute._value.query.name; // 让每个请求携带自定义token 请根据实际情况自行修改
//     }
//     return config;
//   },
//   (error) => {
//     console.log(error);
//     Promise.reject(error);
//   }
// );

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
 
// Object.keys(ElIcon).forEach((key) => {
//     app.component(key, ElIcon[key])
//   })
app.mount('#app');

